package x.trident.core.micro.gateway.core.filters.factory;

import x.trident.core.micro.gateway.core.filters.factory.base.BaseGatewayFilterFactory;
import x.trident.core.micro.gateway.modular.validate.impl.TokenValidateService;
import x.trident.core.scanner.api.pojo.resource.ResourceDefinition;

import javax.annotation.Resource;

/**
 * 认证过滤器，判断当前用户是否带有登录的token
 *
 * @author Seven
 * @date 2021/5/12 22:20
 */
public class AuthJwtTokenGatewayFilterFactory extends BaseGatewayFilterFactory {

    @Resource
    private TokenValidateService tokenValidateService;

    @Override
    public void validateAuth(String token, ResourceDefinition resourceDefinition) {
        tokenValidateService.validate(token, resourceDefinition);
    }

}
